package com.tsll.entity;

import java.io.Serializable;

/**
 * 
 * @TableName bookcomment
 */
public class BookComment implements Serializable {
    /**
     * 图书评论ID
     */
    private Integer bookcommentId;

    /**
     * 图书评论信息
     */
    private String bookcommentMessage;

    /**
     * 图书id
     */
    private Integer bookId;

    /**
     * 用户id
     */
    private Integer userId;

    /**
     * 用户实体类
     */
    private User user;
    /**
     * 图书实体类
     */
    private Book book;

    public BookComment() {
    }

    public BookComment(Integer bookcommentId, String bookcommentMessage, Integer bookId, Integer userId, User user, Book book) {
        this.bookcommentId = bookcommentId;
        this.bookcommentMessage = bookcommentMessage;
        this.bookId = bookId;
        this.userId = userId;
        this.user = user;
        this.book = book;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Book getBook() {
        return book;
    }

    public void setBook(Book book) {
        this.book = book;
    }

    private static final long serialVersionUID = 1L;

    /**
     * 
     */
    public Integer getBookcommentId() {
        return bookcommentId;
    }

    /**
     * 
     */
    public void setBookcommentId(Integer bookcommentId) {
        this.bookcommentId = bookcommentId;
    }

    /**
     * 
     */
    public String getBookcommentMessage() {
        return bookcommentMessage;
    }

    /**
     * 
     */
    public void setBookcommentMessage(String bookcommentMessage) {
        this.bookcommentMessage = bookcommentMessage;
    }

    /**
     * 
     */
    public Integer getBookId() {
        return bookId;
    }

    /**
     * 
     */
    public void setBookId(Integer bookId) {
        this.bookId = bookId;
    }

    /**
     * 
     */
    public Integer getUserId() {
        return userId;
    }

    /**
     * 
     */
    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        BookComment other = (BookComment) that;
        return (this.getBookcommentId() == null ? other.getBookcommentId() == null : this.getBookcommentId().equals(other.getBookcommentId()))
            && (this.getBookcommentMessage() == null ? other.getBookcommentMessage() == null : this.getBookcommentMessage().equals(other.getBookcommentMessage()))
            && (this.getBookId() == null ? other.getBookId() == null : this.getBookId().equals(other.getBookId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getBookcommentId() == null) ? 0 : getBookcommentId().hashCode());
        result = prime * result + ((getBookcommentMessage() == null) ? 0 : getBookcommentMessage().hashCode());
        result = prime * result + ((getBookId() == null) ? 0 : getBookId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", bookcommentId=").append(bookcommentId);
        sb.append(", bookcommentMessage=").append(bookcommentMessage);
        sb.append(", bookId=").append(bookId);
        sb.append(", userId=").append(userId);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}